test: integration tests can now call dynamic libraries#1690
test: integration tests can now call dynamic libraries#1690ostylk wants to merge 1 commit intowild-linker:mainfrom
Conversation
| .with_context(|| format!("Invalid Mode `{arg}`"))?; | ||
| if mode == Mode::Dynamic { | ||
| config.assertions.expect_dynamic = true; | ||
| } |
a178060 to
4c28c32
Compare
|
Thanks for doing this! From a quick look at the test failures, there seem to be two causes. Tests fail on Alpine. Alpine uses musl libc. Although musl libc supports dynamic linking, it's possible that this isn't happening. dlopen doesn't work with statically linked binaries. Probably the easiest option would be to skip the test if The other failures look like they're from trying to use qemu to run the binary. It'd be possible to support this, but we'd need to have the test framework compile an executable for the target arch where that executable loaded the shared object, ran it, then exited with the appropriate code. This could perhaps be done as a follow-up. For now, I'd probably suggest just skipping cross-compilation tests when |
Implements #1687 .
Using
//#RunDynSym:foothe output binary is treated as a shared library and loaded into the current test process.The function
fooneeds to return an integer and it succeeds if it returns42.Cross compiled libraries cannot be tested that way.
Is there one test in particular where you want to use this feature? I enabled it for
shared.cand calledfoo().